﻿using IceCS.EMS.BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IceCS.EMS.UI.WinFormCore
{
    public static class FormService
    {
        /// <summary>
        /// 
        /// </summary>
        public static EmployeeManager EmployeeManager;
        /// <summary>
        /// 
        /// </summary>
        public static DbManager DbManager;

        static FormService()
        {
            EmployeeManager = new EmployeeManager();
            DbManager = new DbManager();
            DbManager.InitDB();
        }

        private static FormMain _formMain;
        public static FormMain FormMain
        {
            get
            {
                if (_formMain == null)
                {
                    _formMain = new FormMain();
                }
                return _formMain;
            }
        }
        private static FormAdd _formAdd;
        public static FormAdd FormAdd
        {
            get
            {
                //if (_formAdd == null)
                //{
                    _formAdd = new FormAdd();
                //}
                return _formAdd;
            }
        }

        private static FormEdit _formEdit;
        public static FormEdit FormEdit
        {
            get
            {
                if (_formEdit == null)
                {
                    _formEdit = new FormEdit();
                }
                return _formEdit;
            }
        }
    }
}
